package com.nali.spreader.dao.impl;

import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.orm.ibatis.SqlMapClientTemplate;
import org.springframework.stereotype.Repository;
import com.nali.spreader.dao.ICrudClientTaskLogDao;
import com.nali.spreader.model.ClientTaskLog;
import com.nali.spreader.model.ClientTaskLogExample;
import org.springframework.orm.ibatis.support.SqlMapClientDaoSupport;

@Repository
public class CrudClientTaskLogDao implements ICrudClientTaskLogDao {

    /**
     * This method was generated by Apache iBATIS ibator.
     * This method corresponds to the database table spreader.tb_client_task_log
     *
     * @ibatorgenerated Wed Jan 11 14:57:16 CST 2012
     */
    public CrudClientTaskLogDao() {
        super();
    }

    /**
     * This field was generated by Apache iBATIS ibator.
     * This field corresponds to the database table spreader.tb_client_task_log
     *
     * @ibatorgenerated Fri Mar 30 16:48:07 CST 2012
     */
    @Autowired
    private SqlMapClientTemplate sqlMap;

    /**
     * This method was generated by Apache iBATIS ibator.
     * This method corresponds to the database table spreader.tb_client_task_log
     *
     * @ibatorgenerated Fri Mar 30 16:48:07 CST 2012
     */
    public int countByExample(ClientTaskLogExample example) {
        Integer count = (Integer) getSqlMapClientTemplate().queryForObject("spreader_tb_client_task_log.ibatorgenerated_countByExample", example);
        return count;
    }

    /**
     * This method was generated by Apache iBATIS ibator.
     * This method corresponds to the database table spreader.tb_client_task_log
     *
     * @ibatorgenerated Fri Mar 30 16:48:07 CST 2012
     */
    public int deleteByExample(ClientTaskLogExample example) {
        int rows = getSqlMapClientTemplate().delete("spreader_tb_client_task_log.ibatorgenerated_deleteByExample", example);
        return rows;
    }

    /**
     * This method was generated by Apache iBATIS ibator.
     * This method corresponds to the database table spreader.tb_client_task_log
     *
     * @ibatorgenerated Fri Mar 30 16:48:07 CST 2012
     */
    public int deleteByPrimaryKey(Long taskId) {
        ClientTaskLog key = new ClientTaskLog();
        key.setTaskId(taskId);
        int rows = getSqlMapClientTemplate().delete("spreader_tb_client_task_log.ibatorgenerated_deleteByPrimaryKey", key);
        return rows;
    }

    /**
     * This method was generated by Apache iBATIS ibator.
     * This method corresponds to the database table spreader.tb_client_task_log
     *
     * @ibatorgenerated Fri Mar 30 16:48:07 CST 2012
     */
    public void insert(ClientTaskLog record) {
        getSqlMapClientTemplate().insert("spreader_tb_client_task_log.ibatorgenerated_insert", record);
    }

    /**
     * This method was generated by Apache iBATIS ibator.
     * This method corresponds to the database table spreader.tb_client_task_log
     *
     * @ibatorgenerated Fri Mar 30 16:48:07 CST 2012
     */
    public void insertSelective(ClientTaskLog record) {
        getSqlMapClientTemplate().insert("spreader_tb_client_task_log.ibatorgenerated_insertSelective", record);
    }

    /**
     * This method was generated by Apache iBATIS ibator.
     * This method corresponds to the database table spreader.tb_client_task_log
     *
     * @ibatorgenerated Fri Mar 30 16:48:07 CST 2012
     */
    @SuppressWarnings("unchecked")
    public List<ClientTaskLog> selectByExampleWithBLOBs(ClientTaskLogExample example) {
        List<ClientTaskLog> list = getSqlMapClientTemplate().queryForList("spreader_tb_client_task_log.ibatorgenerated_selectByExampleWithBLOBs", example);
        return list;
    }

    /**
     * This method was generated by Apache iBATIS ibator.
     * This method corresponds to the database table spreader.tb_client_task_log
     *
     * @ibatorgenerated Fri Mar 30 16:48:07 CST 2012
     */
    @SuppressWarnings("unchecked")
    public List<ClientTaskLog> selectByExampleWithoutBLOBs(ClientTaskLogExample example) {
        List<ClientTaskLog> list = getSqlMapClientTemplate().queryForList("spreader_tb_client_task_log.ibatorgenerated_selectByExample", example);
        return list;
    }

    /**
     * This method was generated by Apache iBATIS ibator.
     * This method corresponds to the database table spreader.tb_client_task_log
     *
     * @ibatorgenerated Fri Mar 30 16:48:07 CST 2012
     */
    public ClientTaskLog selectByPrimaryKey(Long taskId) {
        ClientTaskLog key = new ClientTaskLog();
        key.setTaskId(taskId);
        ClientTaskLog record = (ClientTaskLog) getSqlMapClientTemplate().queryForObject("spreader_tb_client_task_log.ibatorgenerated_selectByPrimaryKey", key);
        return record;
    }

    /**
     * This method was generated by Apache iBATIS ibator.
     * This method corresponds to the database table spreader.tb_client_task_log
     *
     * @ibatorgenerated Fri Mar 30 16:48:07 CST 2012
     */
    public int updateByExampleSelective(ClientTaskLog record, ClientTaskLogExample example) {
        UpdateByExampleParms parms = new UpdateByExampleParms(record, example);
        int rows = getSqlMapClientTemplate().update("spreader_tb_client_task_log.ibatorgenerated_updateByExampleSelective", parms);
        return rows;
    }

    /**
     * This method was generated by Apache iBATIS ibator.
     * This method corresponds to the database table spreader.tb_client_task_log
     *
     * @ibatorgenerated Fri Mar 30 16:48:07 CST 2012
     */
    public int updateByExampleWithBLOBs(ClientTaskLog record, ClientTaskLogExample example) {
        UpdateByExampleParms parms = new UpdateByExampleParms(record, example);
        int rows = getSqlMapClientTemplate().update("spreader_tb_client_task_log.ibatorgenerated_updateByExampleWithBLOBs", parms);
        return rows;
    }

    /**
     * This method was generated by Apache iBATIS ibator.
     * This method corresponds to the database table spreader.tb_client_task_log
     *
     * @ibatorgenerated Fri Mar 30 16:48:07 CST 2012
     */
    public int updateByExampleWithoutBLOBs(ClientTaskLog record, ClientTaskLogExample example) {
        UpdateByExampleParms parms = new UpdateByExampleParms(record, example);
        int rows = getSqlMapClientTemplate().update("spreader_tb_client_task_log.ibatorgenerated_updateByExample", parms);
        return rows;
    }

    /**
     * This method was generated by Apache iBATIS ibator.
     * This method corresponds to the database table spreader.tb_client_task_log
     *
     * @ibatorgenerated Fri Mar 30 16:48:07 CST 2012
     */
    public int updateByPrimaryKeySelective(ClientTaskLog record) {
        int rows = getSqlMapClientTemplate().update("spreader_tb_client_task_log.ibatorgenerated_updateByPrimaryKeySelective", record);
        return rows;
    }

    /**
     * This method was generated by Apache iBATIS ibator.
     * This method corresponds to the database table spreader.tb_client_task_log
     *
     * @ibatorgenerated Fri Mar 30 16:48:07 CST 2012
     */
    public int updateByPrimaryKeyWithBLOBs(ClientTaskLog record) {
        int rows = getSqlMapClientTemplate().update("spreader_tb_client_task_log.ibatorgenerated_updateByPrimaryKeyWithBLOBs", record);
        return rows;
    }

    /**
     * This method was generated by Apache iBATIS ibator.
     * This method corresponds to the database table spreader.tb_client_task_log
     *
     * @ibatorgenerated Fri Mar 30 16:48:07 CST 2012
     */
    public int updateByPrimaryKeyWithoutBLOBs(ClientTaskLog record) {
        int rows = getSqlMapClientTemplate().update("spreader_tb_client_task_log.ibatorgenerated_updateByPrimaryKey", record);
        return rows;
    }

    /**
     * This method was generated by Apache iBATIS ibator.
     * This method corresponds to the database table spreader.tb_client_task_log
     *
     * @ibatorgenerated Fri Mar 30 16:48:07 CST 2012
     */
    public SqlMapClientTemplate getSqlMapClientTemplate() {
        return sqlMap;
    }

    /**
     * This class was generated by Apache iBATIS ibator.
     * This class corresponds to the database table spreader.tb_client_task_log
     *
     * @ibatorgenerated Fri Mar 30 16:48:07 CST 2012
     */
    private static class UpdateByExampleParms extends ClientTaskLogExample {

        private Object record;

        public UpdateByExampleParms(Object record, ClientTaskLogExample example) {
            super(example);
            this.record = record;
        }

        public Object getRecord() {
            return record;
        }
    }
}
